package com.gxa.service.investment.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gxa.entity.investment.BusinessTypeChild;
import com.gxa.mapper.investment.BusinessTypeChildMapper;
import com.gxa.service.investment.BusinessTypeChildService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 招商配置——行业类型——新增子类 服务实现类
 * </p>
 *
 * @author yjl
 * @since 2022-10-17 09:11:43
 */
@Service
public class BusinessTypeChildServiceImpl extends ServiceImpl<BusinessTypeChildMapper, BusinessTypeChild> implements BusinessTypeChildService {

    @Autowired
    private BusinessTypeChildMapper businessTypeChildMapper;

    @Override
    public int add(BusinessTypeChild businessTypeChild) {
        return businessTypeChildMapper.insert(businessTypeChild);
    }

    @Override
    public List<BusinessTypeChild> queryByCoding(Integer businessTypeCoding) {
//        QueryWrapper<BusinessTypeChild> wrapper = new QueryWrapper<>();
//        wrapper.select("business_type_coding").eq("business_type_coding",businessTypeCoding);
        return businessTypeChildMapper.queryByCoding(businessTypeCoding);
    }

    @Override
    public BusinessTypeChild queryById(Integer businessTypeCoding) {
        BusinessTypeChild businessTypeChild=this.businessTypeChildMapper.queryById(businessTypeCoding);
        return businessTypeChild;
    }

    @Override
    public int delete(int id) {
        return businessTypeChildMapper.deleteById(id);
    }

    @Override
    public int update(BusinessTypeChild businessTypeChild) {
        return businessTypeChildMapper.updateById(businessTypeChild);
    }

    @Override
    public List<String> seletChildName() {
        return businessTypeChildMapper.seletChildName();
    }

}
